package com.apes.project.jekunAuto.purchase.service;


import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.project.jekunAuto.purchase.model.Test;
import com.apes.project.jekunAuto.purchase.repository.TestRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 功能：当事人服务
 *
 * @author xul
 * @create 2018-01-23 14:35
 */
@Service("testService")
public class TestService {

    @Autowired
    TestRepository testRepository;

    public Test create(SimpleRequest request) {
        Test test = request.getO(Test.class);
        test = save(test);
        return test;
    }

    protected Test save(Test test) {
       return testRepository.saveAndFlush(test);
    }

    protected Test findOne(long id){
        return testRepository.findOne(id);
    }


}
